<blockquote class="layui-elem-quote">
  <div class="layui-inline">
    <i class="layui-icon layui-icon-list layui-head-icon"></i>
    <span class="layui-font-16 layui-font-green">会员管理</span>
  </div>
</blockquote>
<div class="layui-card">
  <div class="layui-card-body">
    <fieldset class="layui-elem-field">
      <legend>条件搜索</legend>
      <div class="layui-field-box">
        <form class="layui-form layui-form-pane" action="{:url('/store/user')}" method="GET">
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">输入关键字</label>
              <div class="layui-input-inline">
                <input type="text" name="keyword" placeholder="请输入用户名或手机号" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <div class="layui-input-inline">
                <button class="layui-btn" lay-submit lay-filter="search">搜索</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </fieldset>
    <form class="layui-form">
      <table class="layui-table">
        <thead>
          <tr>
            <th>头像</th>
            <th>昵称</th>
            <th>会员等级</th>
            <th>用户类型</th>
            <th>代理类型</th>
            <th>性别</th>
            <th>注册时间</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>

          {foreach $list as $vo}
          <tr>
            <td><img src="{$vo.avatar}" class="layui-circle layui-view-img"></td>
            <td>{$vo.nickname}</td>
            <td>{$vo.grade_name}</td>
            <td>
              {if condition="($vo.type eq 1)"}
              <span class="layui-font-red">普通用户</span>
              {else/}
              <span class="layui-font-green">商户</span>
              {/if}
            </td>
            <td>
              {if condition="($vo.is_agent eq 0)"}
              <span class="layui-font-red">非代理</span>
              {elseif condition="($vo.is_agent eq 1)"/}
              <span class="layui-font-green">省代理</span>
              {elseif condition="($vo.is_agent eq 2)"/}
              <span class="layui-font-green">市代理</span>
              {elseif condition="($vo.is_agent eq 3)"/}
              <span class="layui-font-green">区代理</span>
              {elseif condition="($vo.is_agent eq 4)"/}
              <span class="layui-font-green">VIP代理</span>
              {/if}
            </td>
            <td>{$vo.gender}</td>
            <td>{$vo.register_time|date='Y-m-d H:i:s'}</td>
            <td>
              <a class="layui-btn layui-btn-sm" href="{:url('/store/user/edit',['id'=> $vo.id])}">查看会员</a>
            </td>
          </tr>
          {/foreach}
        </tbody>
      </table>
    </form>
    {$list|raw}
  </div>
</div>
<script>
  layui.use('form', function () {
    var form = layui.form;

    form.render('checkbox');
    form.render('select');
  });              
</script>